home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / PET / S-Super PET / (s)tj.d64 / SCROLL.LEFT.ASM < prev    next >
Assembly Source File  |  2009-01-18  |  2KB  |  60 lines

  1. opt     nolist  ;scroll.left.asm        Sep 27,1983.  Avygdor Moise
  2.  
  3. xdef    write_right_column
  4. xdef    scroll_left
  5.  
  6.  
  7. blank           equ     32
  8. line_length     equ     80
  9. screen_length   equ     16
  10. screen_top      equ     $8000+((25-10)/2)*line_length
  11. right_column    equ     screen_top+79
  12.  
  13. ;-------------------------------------------------------------------------------
  14. write_right_column      equ     *
  15.  
  16.         bsr     scroll_left
  17.         pshs    y,x,d           ;d = address of string
  18.         tfr     d,x
  19.         ldy     #right_column
  20.         loop
  21.                 ldb     ,x+
  22.         quif    eq
  23.                 stb     ,y
  24.                 leay    80,y
  25.         endloop
  26.         puls    d,x,y
  27.         rts
  28. ;-------------------------------------------------------------------------------
  29. scroll_left     equ     *
  30.  
  31.         pshs    y,x,d
  32.  
  33.         lda     #screen_length-1        ;number of lines to move
  34.         ldx     #screen_top+line_length ;top left corner
  35.         ldb     #blank
  36.                                         ;blank out first column on each line
  37.         loop
  38.                 stb     ,x
  39.                 leax    80,x
  40.                 deca
  41.         until   eq
  42.  
  43.                                         ;move all lines one position left
  44.  
  45.         ldx     #screen_top
  46.         ldy     #screen_length*line_length-1    ;number of bytes to move
  47.  
  48.         loop
  49.                 ldb     1,x
  50.                 stb     ,x+
  51.                 leay    -1,y
  52.         until   eq
  53.  
  54.         ldb     #blank
  55.         stb     ,x                      ;blank out the last byte
  56.  
  57.         puls    d,x,y
  58.         rts
  59. end
  60.